import {createRouter, createWebHistory} from "vue-router"
import HomeView from "../views/HomeView.vue";
import WelcomeView from "@/views/WelcomeView.vue";
import MyPokeView from "@/views/poke/MyPokeView.vue";
import LoginView from "@/views/LoginView.vue";
import PokeView from "@/views/poke/PokeView.vue";
import SkillView from "@/views/poke/SkillView.vue";
import AboutUsView from "@/views/AboutUsView.vue";
import DuelView from "@/views/poke/DuelView.vue";
import DuelRoomView from "@/views/poke/DuelRoomView.vue";
import Fish from "@/views/fish/Fish.vue";
import Task from "@/views/fish/Task.vue";

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'home',
            component: HomeView,
            children: [
                {
                    path: '',
                    name: 'welcome',
                    component: WelcomeView
                },
                {
                    path: '/myPoke',
                    name: 'myPoke',
                    component: MyPokeView
                },
                {
                    path: '/poke',
                    name: 'poke',
                    component: PokeView
                },
                {
                    path: '/skill',
                    name: 'skill',
                    component: SkillView
                },
                {
                    path: '/aboutUs',
                    name: 'aboutUs',
                    component: AboutUsView
                },
                {
                    path: '/duel',
                    name: 'duel',
                    component: DuelView
                },
                {
                    path: '/duelRoom/:duelId',
                    name: 'duelRoom',
                    component: DuelRoomView,
                },
                {
                    path: '/fish',
                    name: 'fish',
                    component: Fish,
                    children: [
                        {
                            path: '/task/:taskType',
                            name: 'task',
                            component: Task,
                            props: true,
                        },
                    ]
                },
            ]
        },
        {
            path: "/login",
            name: "login",
            component: LoginView,
        }
    ],
})

export default router
